﻿@model Applica.Models.SponsorInputs345xModel  
<p class="txt txt-c">Your 'My Screen' is a screen completely dedicated to you and the messages, image, and links that you want to provide your customers. </p>
<div class="tabInnar-content">
                    <div class="row">
                      <div class="col-md-4 col-sm-4">
                           <div class="img text-center"><img class="img-responsive phoneImageaboutme" alt="" src="@Url.Content("~/images/mobile/mobile4.jpg")">
                         <img style="display:none;" class="img-responsive phoneImageaboutme" alt="" src="@Url.Content("~/images/mobile/my-screen-android.jpg")">
                         <img style="display:none;" class="img-responsive imgReplaceAndroid-Iphone phoneImageaboutme1" alt="" src="@Url.Content("~/images/see as iphone.png")">
                         <img  class="img-responsive imgReplaceAndroid-Iphone phoneImageaboutme1" alt="" src="@Url.Content("~/images/see as android.png")">
                        </div>
                      </div>
                      <div class="col-md-8 col-sm-8">
                               <div class="upload_view WebVerupload_view_AboutMe">
                        
                              <div class="up_view">
                                  <div  id="spnMessagemyscreen"></div>
                                <div class="form-group">
                                <div class=" col-sm-3">
                                  <div class="user_img-l "><img id="imglogo" src='@Url.Content("~/sponsor_iphone_images/" + Model.ilogo_pic)' alt="" class="img-responsive img-thumbnail"> </div></div>
                                  <div class="col-sm-9">
                                    
                                    <div class="img-upload-data">
                                      <input type="file" id="fileupload1" class="upload_img" name="files[]" multiple>
                                      <div class="progress progress-striped active">
                                        <div style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="45" role="progressbar" class="progress-bar"> <span class="sr-only">45% Complete</span> </div>
                                      </div>
                                         @{
                             var displaynone = "";
                             if (Model.ilogo_pic == "Default.jpg")
                             {
                                 displaynone = "none";
                             }
                             else
                             {
                                 displaynone = "block";

                             }
                     <div id="divRestore" style="display:@displaynone;">
            <span class="image-save">Image saved</span>
                
                 @using (Ajax.BeginForm("restoreFile", "MobileVersion", new AjaxOptions
                 {
                     HttpMethod = "POST",
                     LoadingElementId = "loaderdefaultimage",
                     InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace,
                     UpdateTargetId = "data",
                     OnSuccess = "OnSuccessDefault"

                 }, new { @class = "form-horizontal form clearfix" }))
                 { 
                    @Html.HiddenFor(model => model.Sponsor_ID)
                <span id="data" > </span>
                     <a class=".sendmail" style="text-decoration:underline;color:red;" href="javascript:void(0);" id="btnDefaultImageRestore">restore default image</a>@*
                   <input type="submit" value="Restore default image" id="btnDefaultImageRestore"/>*@  <div style="display: none" id="loaderdefaultimage">
                <img src="@Url.Content("~/images/ajax-loader.gif")" /></div>
                      
                 }
                <script>
                    function OnSuccessDefault(data) {
                        // alert(data.name);
                        $("#imglogo").attr("src", '../sponsor_iphone_images/' + data.name);
                        $("#divRestore").css("display", "none");
                    }

                </script>

            </div>
                                     }
                                   
                                    </div>
                                     </div>
                                </div>
                              </div>
                               @using (Ajax.BeginForm("Update", "MobileVersion", new AjaxOptions
                         {
                             HttpMethod = "POST",
                             LoadingElementId = "loader",
                             OnSuccess = "successmyscreen"

                         }, new { @class = "form-horizontal form clearfix" }))
                         { 
                                @Html.HiddenFor(model => model.sponsor)
                               <div class="topup_view">
                              
                              <div class="form-group">
                                <label for="CompanyName" class="col-sm-3 control-label">Company Name:</label>
                                <div class="col-sm-9">
                                     @Html.TextBoxFor(model => model.icompany_name, new { @class="form-control IncWidth"})
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-3 control-label">Tag Line:</label>
                                <div class="col-sm-9">
                                     @Html.TextAreaFor(model => model.itagline, new { @class="form-control IncWidth"})
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-3 control-label">Message:</label>
                                <div class="col-sm-9">
                                     @Html.TextAreaFor(model => model.imessage_myscreen, new { @class="form-control IncWidth"})
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label for="YourName" class="col-sm-3 control-label">Your Name:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.iname_line, new { @class="form-control IncWidth"})
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label for="Phone" class="col-sm-3 control-label">Phone:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.iphone_number, new { @class="form-control IncWidth"})
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label for="Email" class="col-sm-3 control-label">Email:</label>
                                <div class="col-sm-9">
                                     @Html.TextBoxFor(model => model.iemail_address, new {@class="form-control IncWidth" })
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              <div class="form-group">
                                <label for="Address" class="col-sm-3 control-label">Web Address:</label>
                                <div class="col-sm-9">
                                     @Html.TextBoxFor(model => model.iwebsite, new { @class="form-control IncWidth"})
                                  <input type="text" class="form-control IncWidth" id="Address" placeholder="" value="iwebsite">
                                  <a href="#" class="tooltip-icon"> <img src="@Url.Content("~/images/info_icon.png")" alt=""></a> </div>
                              </div>
                              
                              
                              <div class="form-group">
                                <label class="col-sm-3 control-label" for="PhoneNumber">Phone Number:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.icon_phone_number, new { @class="form-control IncWidth"})
                                  <a class="tooltip-icon" href="#"> <img alt="" src="@Url.Content("~/images/info_icon.png")"></a> </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-3 control-label" for="Email">Email:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.icon_email_address, new { @class="form-control IncWidth"})
                                  <a class="tooltip-icon" href="#"> <img alt="" src="@Url.Content("~/images/info_icon.png")"></a> </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-3 control-label" for="Browser">Browser:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.icon_web_address, new { @class="form-control IncWidth"})
                                  <a class="tooltip-icon" href="#"> <img alt="" src="@Url.Content("~/images/info_icon.png")"></a> </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-3 control-label" for="Facebook">Facebook:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.ifacebook, new { @class="form-control IncWidth"})
                                  <a class="tooltip-icon" href="#"> <img alt="" src="@Url.Content("~/images/info_icon.png")"></a> </div>
                              </div>
                              <div class="form-group">
                                <label class="col-sm-3 control-label" for="Twitter">Twitter:</label>
                                <div class="col-sm-9">
                                    @Html.TextBoxFor(model => model.itwitter, new { @class="form-control IncWidth"})
                                  <a class="tooltip-icon" href="#"> <img alt="" src="@Url.Content("~/images/info_icon.png")"></a> </div>
                              </div>
                              
                            </div>
                            <div class="save_btn">
                              <input type="submit" value="" id="btnSubmit">
                            </div>
                               }
                        </div>
                      </div>
                    </div>
                  </div>
    <script type="text/javascript">
        $(document).ready(function () {

            $('#fileupload1').fileupload({
                dataType: 'json',
                url: '/MobileVersion/UploadFiles',
                autoUpload: true,
                formData: { id: $('#Sponsor_ID').val() },
                done: function (e, data) {

                    $('.file_name').html(data.result.name);
                    $('.file_type').html(data.result.type);
                    $('.file_size').html(data.result.size);
                    $('.file_imglogo').html('sponsor_iphone_images/' + data.result.path);

                    $("#imglogo1").attr("src", "../sponsor_iphone_images/" + data.result.path + "?" +@DateTime.Now.Ticks.ToString() +"");
                     $("#divRestore1").css("display", "block");
                     $("#loaderdefaultimage").css("display", "none");
                     $('.progress').hide();
                 }
             }).on('fileuploadprogressall', function (e, data) {
                 $('.progress').show();
                 var progress = parseInt(data.loaded / data.total * 100, 10);
                 $('.progress .progress-bar').css('width', progress + '%');
             });


         });
         $_blockDelete = false;
         $('#btnDefaultImageRestore').die('click').live('click', function () {
             var rconfirm = confirm('Are you sure?');
             if (rconfirm) {
                 $('#form0').submit();
             }
         });
    </script>